const express = require('express')
const app = express()
app.listen(3001)

//服务器代理
const{createProxyMiddleware}=require('http-proxy-middleware')
const proxy=createProxyMiddleware({
    target:'http://localhost:3000',
    changeOrigin:true
})

//静态资源托管
app.use(express.static('page'))

app.use((req,resp)=>{
    proxy(req,resp)
})